package com.jeffse.light.stream.core.data.context;

import com.jeffse.light.stream.core.data.descriptor.stateDescriptor.ListStateDescriptor;
import com.jeffse.light.stream.core.data.descriptor.stateDescriptor.MapStateDescriptor;
import com.jeffse.light.stream.core.data.descriptor.stateDescriptor.ValueStateDescriptor;
import com.jeffse.light.stream.core.data.state.ListState;
import com.jeffse.light.stream.core.data.state.MapState;
import com.jeffse.light.stream.core.data.state.ValueState;

import java.io.Serializable;

public interface RuntimeContext extends Serializable {
    /**
     * 获取 valueState
     * @param stateProperties
     * @param <T>
     * @return
     */
    public <V, T> ValueState<V> getState(ValueStateDescriptor<T> stateProperties);

    /**
     * 获取 listState
     * @param stateProperties
     * @param <T>
     * @return
     */
    public <V, T> ListState<V> getListState(ListStateDescriptor<T> stateProperties);

    /**
     * 获取 mapState
     * @param stateProperties
     * @param <T>
     * @return
     */
    public <KEY, V, T> MapState<KEY, V> getMapState(MapStateDescriptor<T> stateProperties);
}
